package main

import (
	"github.com/go-redis/redis/v8"
	"log"
)

func NewRedisConn() (client *redis.Client) {
	client = redis.NewClient(&redis.Options{
		Addr:     "localhost:6379",
		Password: "", // no password set
		DB:       0,  // use default DB
	})

	_, err := client.Ping(ctx).Result()
	if err != nil {
		log.Fatal(err)
	}
	return
}